//
// Created by 123 on 2024/12/30.
//
#include "iostream"

using namespace std;

int main030(){
    int a = 10;
    int b = 20;
    //const修饰指针，指针指向可以修改，指针指向的值不能修改
    const int* pa = &a;
    pa = &b;
    cout << *pa << endl;
//    *pa = 200;
    //const修饰的是常量，指针指向不可以修改，指针指向的值可以修改
    int* const p2 = &a;
//    p2 = &b;
    *p2 = 200;
    cout << *p2 << endl;


    //const又修饰指针又修饰常量，指针及指向的值都不能修改
    const int* const p3 = &a;
//    p3 = &b;
//    *p3 = 200;
    //
    return 0;
}